CXXFLAGS=-g -std=c++11
CC=g++

main: productor_consumer count_down_latch_test latch_test four_loop defer_test

productor_consumer: productor_consumer.cc ../mars/libmars.a
	${CC} ${CXXFLAGS} -o productor_consumer productor_consumer.cc -L../mars -lpthread -lmars

count_down_latch_test: count_down_latch_test.cc ../mars/libmars.a
	${CC} ${CXXFLAGS} -o count_down_latch_test count_down_latch_test.cc -L../mars -lpthread -lmars

four_loop: four_loop.cc ../mars/libmars.a
	${CC} ${CXXFLAGS} -o four_loop four_loop.cc -L../mars -lpthread -lmars

latch_test: latch_test.cc ../mars/libmars.a
	${CC} ${CXXFLAGS} -o latch_test latch_test.cc -L../mars -lpthread -lmars

defer_test: defer_test.cc ../mars/libmars.a
	${CC} ${CXXFLAGS} -o defer_test defer_test.cc -L../mars -lpthread -lmars

../mars/libmars.a: ../mars
	$(MAKE) -C ../mars

.PHONY: main
	


